/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package haw.pr2.A3.implementations;
import haw.pr2.A3.interfaces.*;
/**
 *
 * @author Fabian Heidorn, Alexander Kaack
 */
public final class UtilityclassValues {
    
    private UtilityclassValues() {}
    
    // PUBLIC CONSTANTS
    static final double ZERO = 0.0;
    static final double KG_IN_G = 1000;
    static final double KG_IN_T = 0.001;
    static final double MPS_IN_KMH = 3.6;
    private static final double KMH_IN_MPS = 0.2777777778;
    static final double KW_IN_W = 1000;
    static final double KW_IN_MW = 0.001;
    private static final double W_IN_KW = 0.001;
    static final double S_IN_US = 1000000;
    static final double S_IN_MS = 1000;
    private static final double MS_IN_S = 0.001;
    static final double S_IN_M = 0.0166666667;
    static final double S_IN_H = 0.000277777778;
    static final double M_IN_FT = 3.2808399;
    static final double M_IN_KM = 0.001;
    static final double M_IN_NM = 1000000000;
    static final double FT_IN_M = 0.3048;
    private static final double ACC_EARTH = 9.81;
    static final double MINSPEED = 0.0000000000001;
    static final double HOUR_IN_SEC = 3600.0;
    public static final Length CON_LENGTH = lengthInFt(20.0);
    public static final Length CON_WIDTH = lengthInFt(8.0);
    public static final Length CON_HEIGHT = lengthInFt(8.0);
    public static final Length PAL_LENGTH = lengthInM(1.2);
    public static final Length PAL_WIDTH = lengthInM(1.0);
    public static final Length PAL_HEIGTH = lengthInM(1.0);
    public static final Mass PAL_MAX_MASS = massInKg(1500.0);
    public static final Mass PAL_MASS = massInKg(20.0);
    public static final Mass CON_EMPTY_MASS = massInKg(2280.0);
    public static final Mass CON_MAX_MASS = massInKg(24000.0);
    public static final Force ZERO_FORCE = new ForceInN(ZERO);
    public static final Acc ZERO_ACC = new AccInMs(ZERO);
    public static final Length ZERO_LENGTH = new LengthInM(ZERO);
    public static final Length ZERO_WIDTH = ZERO_LENGTH;
    public static final Length ZERO_HEIGHT = ZERO_LENGTH;
    public static final Mass ZERO_MASS = new MassInKg(ZERO);
    public static final Speed ZERO_SPEED = new SpeedInMpS(ZERO);
    public static final Power ZERO_POWER = new PowerInKw(ZERO);
    public static final TimeDiff ZERO_TIMEDIFF = new TimeDiffInS(ZERO);
    public static final BoundingBox EMPTY_BOUNDING_BOX = new BoundingBoxImpl(ZERO_LENGTH, ZERO_WIDTH, ZERO_HEIGHT);
    public static final Stowage EMPTY_PALLET_STOWAGE = PalletStowageImpl.valueOf(0,0,0);
    public static final Stowage EMPTY_CONTAINER_STOWAGE = ContainerStowageImpl.valueOf(0,0,0);
    
    // PUBLIC FACTORIES
    public static Length lengthInM(double meters) {
        return LengthInM.valueOf(meters);
    }
    public static Length lengthInFt(double feet) {
        return LengthInM.valueOf(feet*FT_IN_M);
    }
    public static Speed speedInMs(double ms) {
            return new SpeedInMpS(ms);
    }
    public static Speed speedInKmH(double KmH) {
            return new SpeedInMpS(KmH*KMH_IN_MPS);
    }
    public static MassInKg massInKg(double kg) {
            return new MassInKg(kg);
    }
    public static PowerInKw powerInKw(double kw) {
            return new PowerInKw(kw);
    }
    public static PowerInKw powerInW(double w) {
            return new PowerInKw(w*W_IN_KW);
    }
    public static TimeDiffInS timeDiffInS(double s) {
            return new TimeDiffInS(s);
    }
    public static TimeDiffInS timeDiffInMs(double ms) {
            return new TimeDiffInS(ms*MS_IN_S);
    }
    public static ForceInN forceInN(double f) {
            return new ForceInN(f);
    }
    public static AccInMs accInMs(double acc) {
            return new AccInMs(acc);
    }
    public static AccInMs accEarth() {
            return new AccInMs(ACC_EARTH);
    }
    public static Speed minSpeed() {
            return new SpeedInMpS(MINSPEED);
    }
    public static TimeDiffInS hourInSec() {
            return new TimeDiffInS(HOUR_IN_SEC);
    }    
    
    
   public static BoundingBox boundingBox(Length length, Length width, Length height) {
        return new BoundingBoxImpl(length, width, height);
    }
    
    public static UniqueId uniqueId(long id) {
        return new UniqueIdImpl(id);
    }
    
    public static Name name(String name) {
        return new NameImpl(name);
    }
    
    public static StowageLocation stowageLocation(int bay, int row, int tier) {
        return new StowageLocationImpl(bay, row, tier);
    }
    
    public static StowageLocation nullLocation() {
        return new NullLocation();
    }
   
    
}
